﻿begin transaction SchemaUpdate
print 'transaction "SchemaUpdate" started'

begin try
	
	alter table [Word]
	drop column [Rating]
	print 'Rating dropped by "Word"'
	
	alter table [Word]
	add [Upvotes] bigint default 0 NOT NULL
	print 'Upvotes added to "Word"'

	alter table [Word]
	add [Downvotes] bigint default 0 NOT NULL
	print 'Downvotes added to "Word"'

	update [Version]
	set VersionNr = '1.7'
	print 'VersionNr updated to 1.7'

	commit transaction SchemaUpdate
	print 'transaction "SchemaUpdate" committed'		
	
end try
begin catch	
	rollback transaction SchemaUpdate
	print 'transaction "SchemaUpdate" rolled back'		
end catch